<% deploy_groups = @stage&.deploy_groups || [] %>
<% (@stage || @project).datadog_monitors.each do |monitor| %>
  <% label = {"OK" => "success", "Alert" => "danger", "Warn" => "warning"}[monitor.state(deploy_groups)] || "info" %>
  <%= link_to monitor.name, monitor.url(deploy_groups), class: "label label-#{label}" %>
<% end %>
